<!DOCTYPE html>
<html lang="zh">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui" />
    <meta name="keywords" content="LightYear,LightYearAdmin,光年,后台模板,后台管理系统,光年HTML模板" />
    <meta name="description" content="Light Year Admin V5是一个基于Bootstrap v5.1.3的后台管理系统的HTML模板。" />
    <title>拐点 - 光年(Light Year Admin V5)后台管理系统模板</title>
    <link rel="shortcut icon" type="image/x-icon" href="../favicon.ico" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="default" />
    <link rel="stylesheet" type="text/css" href="../css/materialdesignicons.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.min.css" />
    <style>
        body {
            min-width: 740px;
        }

        ol,
        ul {
            margin: 0 !important;
        }

        [class*='btn'],
        input,
        textarea,
        select {
            outline: 0 !important;
            box-shadow: none !important;
            border-color: gray !important;
        }

        .inputQuery {
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
        }

        .inputQuery>div {
            margin: 0px 8px 0px 8px;
            display: flex;
            align-items: center;
        }

        .inputQuery>div>input {
            margin-left: 8px;
        }

        input input,
        button {
            margin-left: 9px;
        }

        .functionButtons {
            display: flex;
            width: 100%;
            margin-bottom: 1rem;
            justify-content: flex-end;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th,
        td {
            padding: 8px;
            text-align: left;
            /* border: 1px solid black; */
            white-space: nowrap;
            text-overflow: elipse;
        }

        .operate input {
            background-color: white;
            border: 0px;
            padding: 0;
        }


        .paging {
            display: flex;
            justify-content: center;
        }

        .queryCategory {
            position: relative;
            display: flex;
            flex-wrap: wrap;
            align-items: stretch;
            max-height: 35px;
            margin: 0px 8px 0px 8px;
        }
        .form-control{
            max-width: 180px;
        }
    </style>
</head>

<body>
    <div class="container-fluid" id="app">
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <header class="card-header d-flex justify-content-between align-items-center">
                        <!-- breadcrumb navigator start -->
                        <nav id="nav-title" aria-label="breadcrumb">
                            <ol class="breadcrumb">
                                <li>当前位置：</li>
                                <li class="breadcrumb-item">班级</li>信息管理</li>
                                <li class="breadcrumb-item active" aria-current="page">
                                    基本班级信息
                                </li>
                            </ol>
                        </nav>
                        <!-- breadcrumb navigator end -->
                        <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample"
                            role="button" aria-expanded="false" aria-controls="collapseExample" @click="toggle">
                            {{unfoldOrfold}}查询栏
                        </a>
                    </header>
                    <div class="card-body py-0">
                        <!-- query-area card start -->
                        <div id="query-area" class="card mb-3">
                            <!-- query-area collapse start -->
                            <div class="collapse show py-1" id="collapseExample">
                                <!-- query-area card-body start -->
                                <div class="card-body pt-1">
                                    <span class="d-block m-2">范围查询</span>
                                    <div class="row row-cols-3 row-cols-md-3 row-cols-lg-4 row-cols-xl-5">
                                        <!-- <div class="d-flex col p-1"> -->
                                        <div class="col mb-2">
                                            <div class="input-group">
                                                <label class="input-group-text" for="dateOfUpdate">
                                                    专业名称
                                                </label>
                                                <select name="" id="type" class="form-select">
                                                    <option value="1">请选择</option>
                                                    <option value="2">一</option>
                                                    <option value="3">二</option>
                                                    <option value="3">三</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col mb-2">
                                            <div class="input-group">
                                                <label class="input-group-text" for="dateOfUpdate">
                                                    年级
                                                </label>
                                                <select name="" id="type" class="form-select">
                                                    <option value="1">请选择</option>
                                                    <option value="2">一</option>
                                                    <option value="3">二</option>
                                                    <option value="4">三</option>
                                                </select>
                                            </div>
                                        </div>
                                        <!-- <div class="d-flex col p-1"> -->
                                        <div class="col mb-2">
                                            <div class="input-group">
                                                <label class="input-group-text" for="dateOfUpdate">
                                                    状态
                                                </label>
                                                <select name="" id="state" class="form-select">
                                                    <option value="1">请选择</option>
                                                    <option value="2">一</option>
                                                    <option value="3">二</option>
                                                    <option value="4">三</option>
                                                </select>
                                            </div>
                                        </div>

                                        <!-- 查询按钮 -->
                                        <div class="col p-1 d-flex justify-content-end align-items-center">
                                            <button class="btn btn-primary" type="button" @click="">
                                                查询
                                            </button>
                                        </div>
                                    </div>
                                    <span class="d-block m-2">内容查询</span>
                                    <div class="rangeQuery">
                                        <div class="inputQuery">
                                            <div>
                                                <label for="">班级名称</label>
                                                <input type="radio" name="choice" value="className"
                                                    class="form-check-input" />
                                            </div>
                                            <div>
                                                <label for="">班主任</label>
                                                <input type="radio" name="choice" value="classMaster"
                                                    class="form-check-input" />
                                            </div>
                                            <div>
                                                <label for="">班级编号</label>
                                                <input type="radio" name="choice" value="classMaster"
                                                    class="form-check-input" />
                                            </div>
                                            <div class="col-3">
                                                <input type="text" name="textQuery" id="" class="form-control" />
                                            </div>

                                            <div class="h-100 d-flex align-items-center">
                                                <label for="isFuzzy" class="mx-1">模糊查询</label>
                                                <input type="checkbox" id="isFuzzy" class="form-check-input"
                                                    v-model="fuzzy" />
                                            </div>
                                            <button class="btn btn-primary" type="button" @click="">
                                                查询
                                            </button>
                                        </div>
                                    </div>
                                </div>
                                <!-- query-area card-body end -->
                            </div>
                            <!-- query-area collapse end -->
                        </div>
                        <!-- query-area card end -->

                        <div class="functionButtons">
                            <div>
                                <button class="btn btn-primary mb-2">导入</button>
                                <button class="btn btn-primary mb-2">导出</button>
                                <!--添加班级弹出模态框-->
                                <button class="btn btn-primary mb-2" type="button" data-bs-toggle="modal"
                                    data-bs-target="#addClassModal">
                                    添加班级
                                </button>

                            </div>
                        </div>
                        <div class="tableContent overflow-auto">
                            <!-- table开始 -->
                            <table class="table">
                                <thead>
                                    <tr>
                                        <th scope="col">
                                            <input type="checkbox" class="form-check-input" v-model="isAll" />
                                        </th>
                                        <th scope="col">序号</th>
                                        <th scope="col">班级名称</th>
                                        <th scope="col">班级编号</th>
                                        <th scope="col">专业</th>
                                        <th scope="col">年级</th>
                                        <th scope="col">状态</th>
                                        <th scope="col">班主任</th></th>
                                        <th scope="col">班级人数</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>

                                    <!-- vue版 -->
                                    <tr v-for="(item, index) in classArr" :key="item.id">
                                        <td>
                                            <input class="form-check-input" type="checkbox" v-model="item.isChecked" />
                                        </td>
                                        <th scope="row">{{item.id}}</th>
                                        <td class="pointer">
                                            {{item.className}}
                                        </td>
                                        <td class="pointer">
                                            {{item.classId}}
                                        </td>
                                        <td class="pointer">
                                            {{item.speciality}}
                                        </td>
                                        <td>{{item.grade}}</td>
                                        <td>{{item.state}}</td>
                                        <td>{{item.classMaster}}</td>
                                        <td>{{item.member}}</td>
                                        <td class="operate">
                                            <input type="button" value=" 【修改】" data-bs-toggle="modal"
                                                data-bs-target="#updateModal" />|
                                            <input type="button" value="【变更状态】" data-bs-toggle="modal"
                                                data-bs-target="#changeStateModal" />
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <!-- table结束 -->
                        </div>
                    </div>
                    <nav class="paging" aria-label="Page navigation">
                        <ul class="pagination">
                            <li class="page-item">
                                <a class="page-link" href="#">上一页</a>
                            </li>
                            <!-- aria-current=“page”应该用于一组链接。单击链接不会导航到新页面，而只是更改表中可见的行。 -->
                            <li class="page-item active" aria-current="page">
                                <a class="page-link" href="#">1</a>
                            </li>
                            <li class="page-item"><a class="page-link" href="#">2</a></li>
                            <li class="page-item"><a class="page-link" href="#">3</a></li>
                            <li class="page-item"><a class="page-link" href="#">4</a></li>
                            <li class="page-item"><a class="page-link" href="#">5</a></li>
                            <li class="page-item">
                                <a class="page-link" href="#">下一页</a>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>

    <!-- 点击添加班级模态框 -->
    <div class="modal fade" id="addClassModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1"
        aria-labelledby="staticBackdropLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg">
            <div class="modal-content">
                <!-- 标题 -->
                <div class="modal-header">
                    <h1 class="modal-title fs-5" id="addClassModal">添加班级</h1>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <!-- 模态框内容  三个为一组/排-->
                <div class="modal-body">
                    <div class="row mb-3">
                        <!-- 添加班级名称 -->
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="1">班级名称</label>
                                <input type="text" placeholder="请输入..." class="form-control" id="1" />
                            </div>
                        </div>
                        <!-- 添加班级编号 -->
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="1">班级编号</label>
                                <input type="text" placeholder="请输入..." class="form-control" id="1" />
                            </div>
                        </div>
                        <!-- 添加专业 -->
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="1">专业</label>
                                <select id="1" class="form-select" aria-describedby="basic-addon1">
                                    <option value="" selected disabled>请选择...</option>
                                    <option value="1">一</option>
                                    <option value="2">二</option>
                                    <option value="2">三</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <!-- 添加状态 -->
                    <div class="row mb-3">
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="2">状态</label>
                                <select id="2" class="form-select" aria-describedby="basic-addon1">
                                    <option value="" selected disabled>请选择...</option>
                                    <option value="1">一</option>
                                    <option value="2">二</option>
                                    <option value="2">三</option>
                                </select>
                            </div>
                        </div>
                        <!-- 添加班主任 -->
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="1">班主任</label>
                                <input type="text" placeholder="请输入..." class="form-control" id="1" />
                            </div>
                        </div>
                        <!-- 添加班级人数 -->
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="3">班级人数</label>
                                <input type="text" placeholder="请输入..." class="form-control" id="3" />
                            </div>
                        </div>
                        </div>
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="3">年级</label>
                                <input type="text" placeholder="请输入..." class="form-control" id="3" />
                            </div>
                    </div>
                </div>
                <!-- 模态框尾部--按钮 -->
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-bs-dismiss="modal">
                        确认
                    </button>
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
                        取消
                    </button>
                </div>
            </div>
        </div>
    </div>



    <!-- 变更状态弹出模态框 -->
    <div class="modal fade" id="changeStateModal" data-bs-backdrop="static" data-keyboard="false" tabindex="-1"
        aria-labelledby="changeStateModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <h1 class="modal-title fs-5" id="changeStateModal">变更状态</h1>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <div class="input-group mb-3">
                        <span class="input-group-text" id="basic-addon1">专业状态</span>
                        <select name="" id="major" class="input-group-text" aria-describedby="basic-addon1">
                            <option value="" selected disabled>请选择...</option>
                            <option value="1">一</option>
                            <option value="2">二</option>
                            <option value="3">三</option>
                        </select>
                    </div>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" data-bs-dismiss="modal">
                        确认
                    </button>
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
                        取消
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-- 修改班级信息弹出模态框 -->
    <div class="modal fade" id="updateModal" data-bs-backdrop="static" data-keyboard="false" tabindex="-1"
        aria-labelledby="updateModal" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <h1 class="modal-title fs-5" id="updateModal">修改班级信息</h1>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <div class="row mb-3">
                        <div class="col">
                            <div class="input-group">
                                <!--班级编号不可更改-->
                                <label class="input-group-text" for="1">班级编号</label>
                                <input type="text" disabled="disabled" value="" class="form-control" id="1">
                            </div>
                        </div>
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="1">班级名称</label>
                                <input type="text" placeholder="请输入..." class="form-control" id="1" />
                            </div>
                        </div>
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="1">专业</label>
                                <select id="1" class="form-select" aria-describedby="basic-addon1">
                                    <option value="" selected disabled>请选择...</option>
                                    <option value="1">一</option>
                                    <option value="2">二</option>
                                    <option value="2">三</option>
                                </select>
                            </div>
                        </div>
                        </div>
                        <div class="row mb-3">
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="1">年级</label>
                                <select id="1" class="form-select" aria-describedby="basic-addon1">
                                    <option value="" selected disabled>请选择...</option>
                                    <option value="1">21级</option>
                                    <option value="2">22级</option>
                                    <option value="2">23级</option>
                                </select>
                            </div>
                        </div>
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="3">班主任</label>
                                <input type="text" placeholder="请输入..." class="form-control" id="3" />
                            </div>
                        </div>
                        <div class="col">
                            <div class="input-group">
                                <label class="input-group-text" for="3">班级人数</label>
                                <input type="text" placeholder="请输入..." class="form-control" id="3" />
                            </div>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary" data-bs-dismiss="modal">
                            确认
                        </button>
                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
                            取消
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>



    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/popper.min.js"></script>
    <script type="text/javascript" src="../js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../js/main.min.js"></script>
    <script src="../js/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                // 查询栏状态
                unfold: false,
                // 模糊查询选项按钮
                fuzzy: false,
                queryValue: '',
                selectedFieldValue: '0', // 给定值作为默认项
                classArr: [
                    {
                        isChecked: true,
                        id: 1,
                        className: '软件工程',
                        classId:'b001',
                        speciality:'java',
                        grade:'21级',
                        state:'状态',
                        classMaster:'李老师',
                        member:'20',
                    },
                ],
            },
            computed: {
                unfoldOrfold() {
                    return this.unfold ? '展开' : '收起';
                },
                isAll: {
                    get() {
                        return this.classArr.every((item) => item.isChecked);
                    },
                    set(value) {
                        // 基于拿到的布尔值，要让所有的小选框 同步状态
                        this.classArr.forEach((item) => (item.isChecked = value));
                    },
                },
            },
            methods: {
                toggle() {
                    this.unfold = !this.unfold;
                },
            },
            mounted() {
                let a = this.classArr[0];
                this.classArr.splice(0, 0, a, a, a, a, a, a, a, a, a, a, a);
                console.log(this.classArr);
            },
        });
    </script>
</body>

</html>